#!/bin/sh
######################################################################
# WANsim by Ferry Hendrikx, (c) 2008
# postrm script
######################################################################
set -e


# remove WANsim init.d script

update-rc.d -f wansim remove >/dev/null || exit $?


# remove WANsim user from sudoers

FILE="/etc/sudoers"

if [ -w "${FILE}" ]; then
    grep -v wansim ${FILE} > ${FILE}.tmp
    mv ${FILE}.tmp ${FILE}
    chmod 0440 ${FILE}
fi


# remove WANsim user

deluser --system wansim

exit 0
